{% set user = hookable_metadata.context.resource.user %}

{% if user != null %}
    <a
        class="dropdown-item"
        href="{{ path('sylius_admin_impersonate_user', {'username': user.username}) }}"
        {{ sylius_test_html_attribute('customer-actions-impersonate') }}
    >
        {{ ux_icon('tabler:spy', {'class': 'icon dropdown-item-icon'}) }}
        {{ 'sylius.ui.impersonate'|trans }}
    </a>
{% endif %}
